﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeRay3d : OdGeLinearEnt3d
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeRay3d(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeRay3d_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeRay3d obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeRay3d()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeRay3d(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeRay3d() : this(GlobalsPINVOKE.new_OdGeRay3d__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeRay3d(OdGeRay3d line) : this(GlobalsPINVOKE.new_OdGeRay3d__SWIG_1(OdGeRay3d.getCPtr(line)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeRay3d(OdGePoint3d point, OdGeVector3d vect) : this(GlobalsPINVOKE.new_OdGeRay3d__SWIG_2(OdGePoint3d.getCPtr(point), OdGeVector3d.getCPtr(vect)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeRay3d(OdGePoint3d point1, OdGePoint3d point2) : this(GlobalsPINVOKE.new_OdGeRay3d__SWIG_3(OdGePoint3d.getCPtr(point1), OdGePoint3d.getCPtr(point2)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeRay3d set(OdGePoint3d point, OdGeVector3d vect)
		{
			OdGeRay3d result = new OdGeRay3d(GlobalsPINVOKE.OdGeRay3d_set__SWIG_0(this.swigCPtr, OdGePoint3d.getCPtr(point), OdGeVector3d.getCPtr(vect)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeRay3d set(OdGePoint3d point1, OdGePoint3d point2)
		{
			OdGeRay3d result = new OdGeRay3d(GlobalsPINVOKE.OdGeRay3d_set__SWIG_1(this.swigCPtr, OdGePoint3d.getCPtr(point1), OdGePoint3d.getCPtr(point2)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeRay3d Assign(OdGeRay3d line)
		{
			OdGeRay3d result = new OdGeRay3d(GlobalsPINVOKE.OdGeRay3d_Assign(this.swigCPtr, OdGeRay3d.getCPtr(line)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
